package com.bootdo.mall_part.dao;

import com.bootdo.mall_part.domain.MallHousePlot;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
 * 
 * @author haojiangbo
 * @email 2100272728@qq.com
 * @date 2019-11-09 10:12:48
 */
@Mapper
public interface MallHousePlotDao {

	MallHousePlot get(Long id);
	
	List<MallHousePlot> list(Map<String,Object> map);
	
	int count(Map<String,Object> map);
	
	int save(MallHousePlot mallHousePlot);
	
	int update(MallHousePlot mallHousePlot);
	
	int remove(Long id);
	
	int batchRemove(Long[] ids);

	@Select("select *from me_mall_house_plot where city_id=#{cityId}")
    List<MallHousePlot> getByCityId(@Param("cityId") Long cityId);

	@Select("select *from me_mall_house_plot where city_id=#{cityId} and name like '%${name}%'")
    List<MallHousePlot> getByCityIdAndName(@Param("cityId") Long cityId,@Param("name")String name );

	@Select("select *from me_mall_house_plot where name like '%${name}%'")
	List<MallHousePlot> getByName(@Param("name")String name );

	@Select("select * from me_mall_house_plot where type = 1 and city_id = #{cityId}")
	MallHousePlot getCityDefault(@Param("cityId")Long cityId);
}
